"%SWITCH( ){ }" is a Dialog Processing Statement. It consist of two parts the "( )" part and the "{ }" part.
"( )" contain lua code that should result in a number greater or equal to 0.
"{ }" contain a sequence of text, separated by "::".
The whole "%SWITCH( ){ }" is replaced by the Xth (X = value of "( )") text element, starting at 0, given by "{ }".
So "%SWITCH(2){Hello::Hey::Hi}" is replaced by "Hi".